package com.power.sifa.approve.api;

import com.plf.common.domain.ResponseDTO;
import com.power.sifa.approve.model.Apl_main;
import com.power.sifa.approve.model.pageInfo.Apl_mainPageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 业务申请主表 Feign
 */
public interface IApl_mainFeign {

    /**
     * 业务申请主表分页列表
     */
    @PostMapping("/apl_main/list")
    ResponseDTO list(@RequestBody Apl_mainPageInfo apl_mainPageInfo);

    /**
     * 查看业务申请主表
     */
    @GetMapping("/apl_main/view")
    ResponseDTO view(@RequestParam("id") String id);

    /**
     * 删除业务申请主表
     */
    @PostMapping("/apl_main/delete")
    ResponseDTO delete(@RequestParam("id") String id);

    ///**
    // * 查看业务申请主表 复合主键使用
    // */
    //@PostMapping("/apl_main/viewByPK")
    //ResponseDTO viewByPK(@RequestBody Apl_main.Apl_mainPK pk);

    /**
     * 修改或保存业务申请主表
     */
    @PostMapping("/apl_main/save")
    ResponseDTO save(@RequestBody Apl_main apl_main);

    ///**
    // * 删除业务申请主表 复合主键使用
    // */
    //@PostMapping("/apl_main/deleteByPK")
    //ResponseDTO deleteByPK(@RequestBody Apl_main.Apl_mainPK pk);

    /**
     * 批量删除业务申请主表
     */
    @PostMapping("/apl_main/batchDel")
    ResponseDTO batchDel(@RequestParam("ids") String ids);

    /**
     * 导出excel
     */
    @PostMapping("/apl_main/output")
    void output(HttpServletResponse response, @RequestBody Apl_mainPageInfo apl_mainPageInfo);

    /**
     * 导出excel模板
     */
    @PostMapping("/apl_main/exportExcelTemplate")
    void exportExcelTemplate(HttpServletResponse response);

    /**
     * 导入excel
     */
    @PostMapping("/apl_main/importExcel")
    ResponseDTO importExcel(@RequestBody MultipartFile file) throws IOException;

    /**
     * 根据流程实例查询
     */
    @PostMapping("/apl_main/getByid")
    ResponseDTO getByInstid(@RequestParam String instid);

    /**
     * 根据流程实例批量查询
     *
     * @param instids
     * @return
     */
    @PostMapping("/apl_main/getByInstids")
    ResponseDTO getByInstids(@RequestBody List<String> instids);

    /**
     * 更新办结环节组
     *
     * @param instid
     * @param scatid
     * @return
     */
    @PostMapping("/apl_main/updateScatid")
    ResponseDTO updateScatid(@RequestParam String instid, @RequestParam String scatid);

    /**
     * 更新申请主表状态
     *
     * @param id
     * @param status
     */
    @PostMapping("/apl_main/updateStatus")
    ResponseDTO updateStatus(@RequestParam String id, @RequestParam Integer status);

    /**
     * 查询指定业务分派树
     *
     * @param departList 指定节点
     * @return
     */
    @PostMapping("/apl_main/queryUserTreeByDepartids")
    ResponseDTO queryUserTreeByDepartids(@RequestBody List<String> departList);

    /**
     * 查询业务分派树
     *
     * @param applyid
     * @param departid
     * @return
     */
    @PostMapping("/apl_main/queryBusineTree")
    ResponseDTO queryBusineTree(@RequestParam String applyid, @RequestParam String departid);

    /**
     * 根据业务id查询流程taskid
     *
     * @param applyid
     * @return
     */
    @PostMapping("/apl_main/queryTaskidByApplyid")
    ResponseDTO queryTaskidByApplyid(@RequestParam String applyid);

    /**
     * 根据instid查询业务承办人
     *
     * @param instid
     * @return
     */
    @PostMapping("/apl_main/querySecondUseridByInstid")
    ResponseDTO querySecondUseridByInstid(@RequestParam String instid);



    /**
     * 导出全部已完结的案件的Excel
     */
    @PostMapping("/apl_main/exportAllCase")
    void exportAllCase(HttpServletResponse response);

}
